home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / Programs / Virtual.CD.v5.0.2.Network.Edition.WinALL / VCD502EG.exe / Program Files / Virtual CD v5 / Language / ENG / Template / Insert.vtm < prev    next >
Encoding:
Text File  |  2003-02-28  |  1.4 KB  |  51 lines

  1. ' **************************************************
  2. ' * Script generated by Virtual CD v5
  3. ' * Copyright 2003 by H+H Software GmbH
  4. ' **************************************************
  5. Option Explicit
  6.  
  7. Const VCD_ERROR_NONE = 0
  8. Const DLGTITLE = "Virtual CD Script"
  9. Const DLGERRORMSG = "Error while inserting a virtual CD "
  10. Const DLGEC = " EC: "
  11.  
  12. DIM IApi            ' Virtual CD v4 SDK API Object
  13.  
  14. ' Init the VCD SDK object
  15. Set IApi = CreateObject("Vc5api.Api")
  16.  
  17. ' Insert the virtual CDs
  18. #VCDINSERTBLOCK
  19.  
  20. Set IApi = Nothing
  21. WScript.Quit(0)
  22.  
  23. ' **************************************************
  24. ' Insert a virtual CD
  25. ' strVCDDrive - Drive letter (empty for default)
  26. ' strVCDName - Name of the virtual CD
  27. ' **************************************************
  28. Function InsertVCD(strVCDDrive, strVCDName)
  29.     DIM strDrive        ' current drive of a VCD
  30.     DIM strVCDDrives    ' Available virtual dirves
  31.  
  32.     ' If there is no file name stop
  33.     If Len(strVCDName) <> 0 Then
  34.         ' get the virtual drive where the CD is inserted
  35.         strDrive = IApi.VCDGetMountDrive(strVCDName)
  36.         
  37.         ' eject the CD if it was inserted
  38.         If Len(strDrive) <> 0 then
  39.             IApi.VCDEject(strDrive)
  40.         End If
  41.     
  42.         ' insert the virtual CD
  43.         InsertVCD = IApi.VCDInsert(strVCDDrive, strVCDName, "")
  44.         
  45.         ' if something was wrong come up with an error
  46.         If InsertVCD <> VCD_ERROR_NONE then
  47.             MsgBox DLGERRORMSG & strVCDName & DLGEC & InsertVCD, vbExclamation, DLGTITLE
  48.         End If
  49.     End If
  50. End Function
  51.